package cn.wit.test;

import java.util.ArrayList;
import java.util.Arrays;
import java.util.Iterator;

/**
 * 数组的演示
 * 
 * @author 16604
 *
 */
public class DemoArray {
	public static void main(String[] args) {
		// double[] scores;
		double[] scores = new double[10];

		int[] a = new int[] { 3, 2, 1 };

		// System.out.println(a.length);

		System.out.print("排序前的数组：");
		for (int e : a) {
			System.out.print(e + " ");
		}
		System.out.println("");
		// 数组排序
		Arrays.sort(a);
		System.out.print("排序后的数组" + Arrays.toString(a)+" ");
		
		//二分查找
		int index = Arrays.binarySearch(a,1);
		System.out.println("二分查找结果:"+a[index]);
		

	}

}
